﻿using System;
using WeiXinPF.Common;
using WeiXinPF.Templates;

namespace WeiXinPF.Web.shop
{
    /// <summary>
    /// 名优推荐详情页
    /// </summary>
    public partial class recommend_detail : ShopBasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            base.OnInit(e);

            if (!string.IsNullOrEmpty(errInitTemplates))
            {
                Response.Write(errInitTemplates);
                return;
            }

            BLL.wx_userweixin bll = new BLL.wx_userweixin();
            Model.wx_userweixin wxModel = bll.GetModel(wid);

            string thisUrl = MyCommFun.getTotalUrl();
            OAuth2BaseProc(wxModel, "reward_detail", thisUrl);

            BLL.wx_module_templates tBll = new BLL.wx_module_templates();
            templateFileName = tBll.GetTemplatesFileNameByWid("shop", wid);
            if (templateFileName == null || templateFileName.Trim() == "")
            {
                errInitTemplates = Constants.MessageNoTempate;
                Response.Write(errInitTemplates);
                Response.End();
                return;
            }

            serverPath = MyCommFun.GetRootPath() + "/shop/templates/" + templateFileName + "/recommend_detail.html";
            ShopTemplateMgr template = new ShopTemplateMgr(
                "/shop/templates/" + templateFileName, serverPath, wid);
            template.tType = TemplateType.RecommendDetail;
            template.openid = openid;
            template.OutPutHtml(wid);
        }
    }
}